jQuery(document).ready(function() {
	//创建JQGRID表格
	
	var grid = $("#table1").ligerGrid({
        columns: [
                  { display: '退货单号', name: 'returnpocode', width: 190 },
                  { display: '采购编号', name: 'pocode', width: 190 },
                  { display: '采购入库单号', name: 'powarecode', width: 190 },
                  { display: '仓库名称', name: 'whname', width: 110},
                  { display: '单据状态', name: 'billstatus', width: 110,
                	  render: function (item){
                		  var billStatus=item.billstatus;
                		  if(billStatus=="0"){
                			  return "草稿";
                		  }if(billStatus=="1"){
                			  return "待二级审批";
                		  }
                		  if(billStatus=="2"){
                			  return "待三级审批";
                		  } 
                		  if(billStatus=="3"){
                			  return "审核完成";
                		  }
                	  }},
                	  { display: '退款状态', name: 'paymentstatus', width: 150,
                    	  render: function (item){
                    		  var paymentstatus=item.paymentstatus;
                    		  if(paymentstatus=="0"){
                    			  return "未退款";
                    		  }
                    		  if(paymentstatus=="1"){
                    			  return "部分退款";
                    		  }
                    		  if(paymentstatus=="2"){
                    			  return "全部退款";
                    		  }
                    	  }},
                  { display: '创建人', name: 'dcruser', width: 150},	  
                  { display: '退货日期', name: 'thrq', width: 120,
                	  render: function (item){
                		  var cdate=new Date(item.thrq);
                		  return formatDate(cdate,"yyyy-MM-dd");
                	  }},
                  { display: '备注', name: 'remark', width: 120 }
                      ],  usePager: true,pageSize:15,pageSizeOptions :[15,30,45,60],enabledSort:false,
                      url : basic_Url+"/list.do",
                      width: "100%", height:"98%", checkbox: false,rownumbers:true,      
                      onDblClickRow : function (data, rowindex, rowobj){
                    	  edit(data);
                       }
                  });
	$("#pageloading").hide();
});

